; ###################################### ; ; Advanced Mp3 Playlist Generator ; ; Created by: Sabby ; Email: mirc_sabby@hotmail.com ; Network: ETG (irc.enterthegame.com) ; Channel: #Helpdesk ; Syntax: ; /mpl [-f | -s | -l | -k] <-h | -t> [Directory] ; -f = File Name ; -s = Size of File ; -l = Length of File ; -k = Kbps of File ; These are optional, the default = -fslk ; ; -h = HTML File ; -t = TXT File ; These MUST be entered ; ; Directory is also optional, if not supplied ; script will ask you through a $sdir dialog ; ; NOTE: ; When you create a txt file, i made each input ; (filename,size,length,kbps) seperated by $chr(160) ; this is an invisible char and i did this so you can seperate ; each one using $gettok if you wish.. Update to come ; is to make you choose the char. ; ; NOTE: ; When you are creating the list, mirc may seem to be ; freezed but it is not! It is just reading the date and it ; will take longer for more mp3s ; ; Examples: ; /mpl -h (creates default html playlist) ; /mpl -t (creates default text playlist) ; /mpl -h C:\Mp3s\ (creates a default html playlist for C:\Mp3s\) ; /mpl -t C:\Mp3s\ (you should know... text file thats right!) ; /mpl -fl -h (creates a html playlist that has the file name and its length) ; /mpl -fsk -t C:\Mp3s\ (creates a text playlist with file name, size, and kbps in the directory C:\Mp3s\) ; ; ###################################### alias mpl { ; Variable Settings var %l = $ [ $+ [ $0 [ $+ [ - ] ] ] ] if ($0 == 1) || (: !isin %l) { var %dir = $sdir($mircdir,Mp3 Directory) } if (: isin %l) { var %dir = $shortfn(%l)) } var %file = mpl. $+ $iif($ [ $+ [ $iif(- isin %l,$0,$calc($0 -1)) ] ] == -h,html,txt) var %w = write %file ; Error Checking if (!$isdir(%dir)) || (!$1) { echo -s *** /mpl: Error | return } $iif($isfile(%file),.remove %file) var %z = $iif((-h isin $1) || (-t isin $1),fslk,$remove($1,-)) window -hs @mpl ; This writes all the coding, Songs name.. Size.. Length.. Kbps ; check the /mplu alias at the bottom of this snippet var %m = $findfile(%dir,*.mp3,0) var %f = $findfile(%dir,*.mp3,0,mplu %file %z $+($1-,$chr(160),%m)) $iif(html isin %file,goto html,goto txt) ; HTML Coding (Done in tables..) :html %w $+(,$me,'s Mp3 Playlist) %w %w $+(

,$me,'s Playlist

) %w %w $+(, $& $iif(f isin %z,), $& $iif(s isin %z,), $& $iif(l isin %z,), $& $iif(k isin %z,)) ; Inputs all the text from the window savebuf -a @mpl %file %w
Song NameSizeLengthKbps
%w %w goto final ; TXT Coding (easy eh?) :txt savebuf @mpl %file goto final ; Final Commands (closes window, unsets vars, closes progressbar) :final window -c @mpl unset %mpl::blah unset %mpl:::blah .timer -m 1 500 window -c @progbar ; If you want to remove the echoing in the status window remove the bottom line it wont hurt anything echo -s *** /MPL: Finished creating: $mircdir $+ %file ; Opens Playlist .run %file } ; Updates HTML and Progress bar alias -l mplu { var %f = $shortfn($gettok($3-,1,160)),%lf = $longfn(%f) ; HTML Coding if (html isin $1) { aline @mpl $+(, $& $iif(f isin $2,$+(,$remove($nopath(%lf),.mp3),)),$iif(s isin $2,$+(,$bytes($file(%f).size).suf,)), $& $iif(l isin $2,$+(,$duration($calc($sound(%f).length /1000)),)),$iif(k isin $2,$+(,$sound(%f).bitrate),),) } ; Text Coding else { aline @mpl $+($iif(f isin $2,$+($remove($nopath(%lf),.mp3),$chr(160))),$iif(s isin $2,$+($bytes($file(%f).size).suf,$chr(160))), $& $iif(l isin $2,$+($duration($calc($sound(%f).length /1000)),$chr(160))),$iif(k isin $2,$sound(%f).bitrate)) } inc %mpl::blah set %mpl:::blah $round($calc((%mpl::blah / $gettok($3-,2,160)) *100),0) mplp %mpl:::blah } ; Progress bar alias -l mplp { $iif(!$window(@progbar),window -BCdfhk0op +f @progbar -1 -1 200 20) window -hpBf +d @progtemp -1 -1 200 20 drawrect -nfr @progbar $rgb(225,225,225) 1 0 0 200 20 drawrect -fr @progtemp $rgb(51,85,119) 1 0 0 200 20 drawtext -nr @progbar $rgb(0) "tahoma bold" -8 $calc((200 - $width($1-,tahoma bold,-8)) / 2) 3 $+($1,$chr(37)) drawtext -r @progtemp $rgb(255,255,255) "tahoma bold" -8 $calc((200 - $width($1-,tahoma bold,-8)) / 2) 3 $+($1,$chr(37)) drawcopy -n @progtemp 0 0 $calc($1 * 2) 20 @progbar 0 0 drawdot @progbar $iif(!$window(@progbar),window -a @progbar) window -c @progtemp } ; Credits ; I would like to thank #Helpdek for there help ; DrunkDwarf, for his help ; Reviewer, for reviewing this snippet ; and You!, for useing this snippet